﻿using System;

namespace Needle.Utils.Extensions
{
    /// <summary></summary>
    public static class ExceptionExtensions
    {

        /// <summary></summary>
        public static Exception GetRootCause(this Exception exception)
        {
            Exception ex = exception;
            while (ex.InnerException != null)
                ex = ex.InnerException;
            return ex;
        }

    }
}
